package com.huike.web.controller.report;


import com.huike.clues.domain.vo.IndexStatisticsVo;
import com.huike.common.core.domain.AjaxResult;
import com.huike.report.domain.vo.IndexVo;
import com.huike.report.service.IReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    IReportService iReportService;


    @GetMapping("salesStatistic")
    public AjaxResult getclues(IndexStatisticsVo request) {
        List<Map<String, Object>> maps1 = iReportService.salesStatisticsForIndex1(request);
        return AjaxResult.success("线索龙虎榜成功", maps1);
    }

    //商机
    @GetMapping("businessChangeStatistics")
    public AjaxResult getbusiness(IndexStatisticsVo request) {
        List<Map<String, Object>> maps = iReportService.salesStatisticsForIndex(request);
        return AjaxResult.success("商机龙虎榜成功", maps);
    }

    @GetMapping
    public AjaxResult shuju(String beginCreateTime, String endCreateTime) {
        IndexVo indexVo = iReportService.getIndexs(beginCreateTime, endCreateTime);
        return AjaxResult.success(indexVo);
    }
}
